import React, { Component } from "react";
import { Button, Popconfirm, Icon } from "antd";
import websiteService from "../service/website.service";

export default class ClearCacheButton extends Component { 

    handleClick = async () => { 
        await websiteService.cacheRemoveAll();
        alert("缓存清楚成功");
    }

    render() { 
        return (<Popconfirm title="缓存有助于提高响应速度,确实要清楚吗?" icon={<Icon type="question-circle-o" style={{ color: 'red' }} />} onConfirm={this.handleClick}>
            <a type="danger">重置缓存</a>
        </Popconfirm>)
    }
}